import { createRouter,createWebHashHistory } from "vue-router"

const Home = ()=>import("../views/home.vue");
const About =()=>import("../views/about.vue");
const UserCenter = ()=>import("../views/UserCenter/index.vue");
const UserProfile = ()=>import("../views/UserCenter/profile.vue");
const VuexPage = ()=>import("../views/Vuex.vue")
const UserSettings = ()=>import("../views/UserCenter/settings.vue");
const ListDemo = ()=>import("../views/ListDemo.vue")
const Account = ()=>import("../views/AccountList.vue")
const routes=[
    {path:"/",redirect:"/home"},
    {path:"/home",name:"home",component:Home},
    {path:"/about",name:"about",component:About},
    {path:"/vuex",name:"vuex",component:VuexPage},
    {path:"/listdemo",name:"ListDemo",component:ListDemo},
    {path:'/account',name:"account",component:Account},
    {
        path:"/user",
        name:"userCenter",
        component:UserCenter,
        children:[
            {
               path:"/profile",
               name:"profile",
               component:UserProfile 
            },
            {
                path:"/settings",
                name:"settings",
                component:UserSettings
            }
        ]
    }
]
const router  = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router